from sklearn.datasets import load_breast_cancer
cancer = load_breast_cancer()


from sklearn.model_selection import train_test_split

X_train,X_test,Y_train,Y_test = train_test_split(cancer.data,
                                                 cancer.target,stratify=cancer.target,random_state=66)

from sklearn.preprocessing import StandardScaler
nn =StandardScaler()
X_train = nn.fit_transform(X_train)
X_test =  nn.fit_transform(X_test)

from sklearn.neural_network import MLPClassifier
mlp = MLPClassifier(solver='lbfgs',hidden_layer_sizes=[10,10],activation='tanh',alpha=1)
mlp.fit(X_train,Y_train)

print('=======================================================\n')
print('测试数据集得分：{0}'.format(mlp.score(X_test,Y_test)))
print('=======================================================\n')